package com.cmy.framework.mvvm.binding.viewadapter.checkbox

import android.widget.CheckBox
import androidx.databinding.BindingAdapter
import com.cmy.framework.mvvm.binding.command.BindingConsumer

/**
 * @name:
 *  ViewAdapter
 * @package:
 *  com.cmy.framework.mvvm.binding.viewadapter.checkbox
 * @date:
 *  2023/3/2215:33
 * @author
 *    cmy
 * @description
 *
 */
object ViewAdapter {

    /**
     * @param bindingCommand //绑定监听
     */
    @JvmStatic
    @BindingAdapter( "binding:onCheckedChangedCommand")
    fun setCheckedChanged(checkBox: CheckBox, bindingCommand: CheckBoxConsumer?) {
        checkBox.setOnCheckedChangeListener { _, b -> bindingCommand?.call(b) }
    }



}


public interface CheckBoxConsumer : BindingConsumer<Boolean>{

}